package com.chianghao.nio.core.handle.http;

/**
 * @author ChiangHao
 */
public class HttpRequestKey {

    private HttpMethod method;
    private String url;

    public HttpRequestKey(HttpMethod method,String url){
        this.method = method;
        this.url = url;
    }

    public HttpMethod getMethod() {
        return method;
    }

    public void setMethod(HttpMethod method) {
        this.method = method;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @Override
    public boolean equals(Object obj) {
        HttpRequestKey key = (HttpRequestKey) obj;
        return key.getMethod().equals(this.method)&&key.getUrl().equals(this.url);
    }

    @Override
    public int hashCode() {
        return (this.method.name()+"_"+this.url).hashCode();
    }
}
